<!DOCTYPE html>
<html lang="en">
<head>
<title>登陆</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link rel="stylesheet" href="login/bootstrap.min.css" />
<link rel="stylesheet" href="login/css/camera.css" />
<link rel="stylesheet" href="login/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="login/matrix-login.css" />
<link rel="stylesheet" href="login/font-awesome.css" />
<script type="text/javascript" src="login/js/jquery-1.5.1.min.js"></script>
  <script>
  		//window.setTimeout(showfh,3000); 
  		var timer;
		function showfh(){
			fhi = 1;
			//关闭提示晃动屏幕，注释掉这句话即可
// 			timer = setInterval(xzfh2, 10); 
		};
		var current = 0;
		function xzfh(){
			current = (current)%360;
			document.body.style.transform = 'rotate('+current+'deg)';
			current ++;
			if(current>360){current = 0;}
		};
		var fhi = 1;
		var current2 = 1;
		function xzfh2(){
			if(fhi>50){
				document.body.style.transform = 'rotate(0deg)';
				clearInterval(timer);
				return;
			}
			current = (current2)%360;
			document.body.style.transform = 'rotate('+current+'deg)';
			current ++;
			if(current2 == 1){current2 = -1;}else{current2 = 1;}
			fhi++;
		};
	</script>
</head>
<body>

	<div style="width:100%;text-align: center;margin: 0 auto;position: absolute;">
		<!-- 登录 -->
		<div id="windows1">
		<div id="loginbox" >
			<form action="" method="post" name="loginForm" id="loginForm">
				<div class="control-group normal_text">
					<h3>
						<img src="login/logo.png" alt="Logo" />
					</h3>
				</div>
				<div class="control-group">
					<div class="controls">
						<div class="main_input_box">
							<span class="add-on bg_lg">
							<i><img height="37" src="login/user.png" /></i>
							</span><input type="text" name="loginname" id="loginname" value="" placeholder="请输入用户名" />
							<div id="lmes" style="color: red"></div>
						</div>
					</div>
				</div>
				<div class="control-group">
					<div class="controls">
						<div class="main_input_box">
							<span class="add-on bg_ly">
							<i><img height="37" src="login/suo.png" /></i>
							</span><input type="password" name="password" id="password" placeholder="请输入密码" class="keypad" keypadMode="full" allowKeyboard="true" value=""/>
						</div>
					</div>
				</div>
				<div class="form-actions">
					<!-- 验证码图片 -->
					<div style="width:86%;padding-left:8%;">
						<div style="float: left;padding-top:2px;">
							<i><img src="/picCode/getCode" id="loginCodeImg"/></i>
						</div>
						<!-- 验证码输入框 -->
						<div style="float: left;margin: 2px 0px 0px 8px" class="codediv">
							<input type="text" placeholder="验证码" style="width: 80px" id="loginCode"/>
						</div>
						<!-- 登录按钮 -->
						<span class="pull-right" ><button  type="button"  id="loginSubmit" class="flip-link btn btn-info" >登录</button></span>
					</div>
				</div>
			</form>
			<div class="controls">
				<div class="main_input_box">
					<font color="white"><span id="nameerr">Copyright © DD平台 2019</span></font>
				</div>
			</div>
		</div>
		</div>
		</div>
		
	<div id="templatemo_banner_slide" class="container_wapper">
		<div class="camera_wrap camera_emboss" id="camera_slide">
			<!-- 背景图片 -->
			<div data-src="login/images/5.jpg"></div>
			<div data-src="login/images/6.jpg"></div>
			<div data-src="login/images/7.jpg"></div>
			<div data-src="login/images/8.jpg"></div>
		</div>
		<!-- #camera_wrap_3 -->
	</div>

	<script type="text/javascript">
	
		$(document).ready(function() {
			changeCode1();
			$("#codeImg").bind("click", changeCode1);
			$("#zcodeImg").bind("click", changeCode2);
		});

		$(document).keyup(function(event) {
			if (event.keyCode == 13) {
				$("#to-recover").trigger("click");
			}
		});

		function genTimestamp() {
			var time = new Date();
			return time.getTime();
		}

		function changeCode1() {
			changeRegisterCode();
		}
		function changeCode2() {
			changeLoginCode();
		}

		
		function savePaw() {
			if (!$("#saveid").attr("checked")) {
				$.cookie('loginname', '', {
					expires : -1
				});
				$.cookie('password', '', {
					expires : -1
				});
				$("#loginname").val('');
				$("#password").val('');
			}
		}

		function saveCookie() {
			if ($("#saveid").attr("checked")) {
				$.cookie('loginname', $("#loginname").val(), {
					expires : 7
				});
				$.cookie('password', $("#password").val(), {
					expires : 7
				});
			}
		}
		
		jQuery(function() {
			var loginname = $.cookie('loginname');
			var password = $.cookie('password');
			if (typeof(loginname) != "undefined"
					&& typeof(password) != "undefined") {
				$("#loginname").val(loginname);
				$("#password").val(password);
				$("#saveid").attr("checked", true);
				$("#code").focus();
			}
		});

	</script>
	<script type="text/javascript">
	   $(function(){
		   alert("dd");
		 //服务器校验
			/* function severCheck(){
					if(check()){
							alert(123);
						$.ajax({
							url:"/login",
							type:"post",
							data:{
								account:$("#loginname").val(),
								pass:$("#password").val(),
								code:$("#loginCode").val()
							},
							dataType:"json",
							success:function(data){
								if(data.indexOf("成功")){
									location.reload();
								}
							}
						});
						});
					}
				}  */
		   
		 
		
		  
	   });
	 //客户端校验
		function check() {
			if ($("#loginname").val() == "") {
				$("#loginname").tips({
					side : 2,
					msg : '用户名不得为空',
					bg : '#AE81FF',
					time : 1
				});
				showfh();
				$("#loginname").focus();
				return false;
			} else {
				$("#loginname").val(jQuery.trim($('#loginname').val()));
			}
			if ($("#password").val() == "") {
				$("#password").tips({
					side : 2,
					msg : '密码不得为空',
					bg : '#AE81FF',
					time : 1
				});
				showfh();
				$("#password").focus();
				return false;
			}
			if ($("#loginCode").val() == "") {
				$("#loginCode").tips({
					side : 1,
					msg : '验证码不得为空',
					bg : '#AE81FF',
					time : 1
				});
				showfh();
				$("#code").focus();
				return false;
			}
			$("#loginbox").tips({
				side : 1,
				msg : '正在登录 , 请稍后 ...',
				bg : '#68B500',
				time : 1
			});
			return true;
		}

	   /* 切换验证码  */
	   $("#loginCodeImg").click(function(){
		   changeLoginCode();
	   });
	   /* 登录信息提交 */
	   $("#loginSubmit").click(function(){
		   alert($("#loginname").val());
	   if(check()){
		$.ajax({
			url:"/user/login",
			type:"post",
			data:{
				account:$("#loginname").val(),
				pass:$("#password").val(),
				code:$("#loginCode").val()
			},
			success:function(data){
					alert(data);
				if(data.indexOf("成功")!=-1){
					window.location.href="check.html";
				}
			}
		});	
	   }
	});
		function changeLoginCode(){
			$("#loginCodeImg").prop("src","/picCode/getCode?a="+Math.random());
		}
	</script>
	</script>
	<script src="js/jquery.js"></script>
	<script src="login/js/bootstrap.min.js"></script>
	<script src="js/jquery-1.7.2.js"></script>
	<script src="login/js/jquery.easing.1.3.js"></script>
	<script src="login/js/jquery.mobile.customized.min.js"></script>
	<script src="login/js/camera.min.js"></script>
	<script src="login/js/templatemo_script.js"></script>
	<script src="login/js/ban.js"></script>
	<script type="text/javascript" src="js/jQuery.md5.js"></script>
	<script type="text/javascript" src="js/jquery.tips.js"></script>
	<script type="text/javascript" src="js/jquery.cookie.js"></script>
	
</body>

</html>